package org.github.manx98.jlibhac.fs.fsa;

import java.io.IOException;
import java.util.List;

/**
 * @author Manx98
 * @version 1.0
 * @since 2022/10/3 13:28
 */
public abstract class IDirectory {
    /**
     * Retrieves the next entries that this directory contains. Does not search subdirectories.
     * @param entryBuffer The buffer the entries will be read into.
     * @return The number of entryBuffer that were read into
     */
    public long read(DirectoryEntry[] entryBuffer) throws IOException {
        return doRead(entryBuffer);
    }

    /**
     * Retrieves the number of file system entries that this directory contains. Does not search subdirectories.
     * @return The number of child entries the directory contains.
     */
    public long getEntryCount() {
        return doGetEntryCount();
    }

    public abstract long doRead(DirectoryEntry[] entryBuffer) throws IOException;

    public abstract long doGetEntryCount();
}
